package com.lenovo.function;

import com.lenovo.bean.User;
import com.lenovo.bean.UserProfile;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.client.*;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.PageFilter;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.IOException;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author lucl
 *         HBase的配置实例
 *
 */
public class Utils_J {
    private static final Log LOG = LogFactory.getLog(Utils_J.class);

    String buStr = "123";

    public List<User> getManagerItcode(List<User> users){

        for (  User u : users  ) {
            getManagerItcodeByEmpId(users,u.getManager_id());
        }

        return users;
    }

    public void getManagerItcodeByEmpId(List<User> users ,String empId){
        for (  User u : users  ) {
            if (u.getEmployee_id().equals(empId)){
                if (buStr.contains(u.getItcode())){
                    u.setBu(u.getItcode());
                }else{
                    getManagerItcodeByEmpId(users,empId);
                }
            }
        }
    }
}